using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Microsoft.TeamFoundation.Server;

namespace WIAssistant
{
    /// <summary>
    /// Used to hold of list of default columns for work items in a given project.
    /// </summary> 
    public class WITSelectorProject: INotifyPropertyChanged 
    {
        public WITSelectorProject()
        {
            _witNodes = new ObservableCollection<WITSelectorNode>();
        }
        public String WITProjectName { get; set; }
        private ObservableCollection<WITSelectorNode> _witNodes;
        public ObservableCollection<WITSelectorNode> WITNodes
        {
            get { return _witNodes; }
            set
            {
                _witNodes = value;

                OnPropertyChanged("WITNodes");
            }
        }

        public override string ToString()
        {
            if (WITProjectName != null)
                return WITProjectName;
            return "";
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}